    function get() {
    let str = $('#mobile').val().trim();
    if (str) {
    var myreg = /^1([3456789])\d{9}$/;
    if (!myreg.test(str)) {
    alert('手机号格式不正确');
} else {
    let phoneNumEnc = window.btoa(str);
    $.ajax({
    type: 'GET',
    url: httpUrl+'/api/v1/open/purchased?phoneNumEnc='+phoneNumEnc,
    success: function(result) {
    if(result.code=='10000'){
    var targetUrl = 'coupon.html';
    var g = getQueryVariable('g');
    if (g) {
    targetUrl += '?g=' + encodeURIComponent(g);
}
    targetUrl += (g ? '&' : '?') + 'p=' + encodeURIComponent(str);
    window.location.href = targetUrl;
}else{
    alert(result.msg)
}
},
    error: function(xhr, status, error) {
    alert('网络波动，请稍后再试。');
}
});





}
} else {
    alert('请先输入手机号');
}
}
    function closeWindow(){
    var window1 = document.getElementById('floating-window1');
    var window2 = document.getElementById('floating-window2');
    window1.style.display = 'none';
    window2.style.display = 'block';
}
